%h3.page_title
  Projects
  = link_to 'New Project', new_project_path, class: "btn btn-small pull-right"

%hr

.row
  .span4
    .admin-filter
      = form_tag admin_projects_path, method: :get, class: 'form-inline' do
        .control-group
          = label_tag :name, 'Name:', class: 'control-label'
          .controls
            = text_field_tag :name, params[:name], class: "span2"

        .control-group
          = label_tag :namespace_id, 'Namespace:', class: 'control-label'
          .controls
            = select_tag :namespace_id, namespaces_options(params[:namespace_id], :all), class: "chosen span2", prompt: "Any"
        .control-group
          = label_tag :public_only, 'Public Only', class: 'control-label'
          .controls
            = check_box_tag :public_only, 1, params[:public_only]
        .control-group
          = label_tag :with_push, 'Not empty', class: 'control-label'
          .controls
            = check_box_tag :with_push, 1, params[:with_push]
            &nbsp;
            %span.light Projects with push events
        .control-group
          = label_tag :abandoned, 'Abandoned', class: 'control-label'
          .controls
            = check_box_tag :abandoned, 1, params[:abandoned]
            &nbsp;
            %span.light No activity over 6 month



        .form-actions
          = submit_tag "Search", class: "btn submit btn-primary"
          = link_to "Reset", admin_projects_path, class: "btn"
  .span8
    .ui-box
      %h5.title
        Projects (#{@projects.total_count})
      %ul.well-list
        - @projects.each do |project|
          %li
            - if project.public
              %i.icon-share
            - else
              %i.icon-lock.cgreen
            = link_to project.name_with_namespace, [:admin, project]
            .pull-right
              = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
              = link_to 'Destroy', [project], confirm: remove_project_message(project), method: :delete, class: "btn btn-small btn-remove"
        - if @projects.blank?
          %p.nothing_here_message 0 projects matches
    = paginate @projects, theme: "gitlab"
